//
//  BeanGunConfigIdx.m
//  RtspClient
//
//  Created by qi tan on 2024/1/10.
//  Copyright © 2024 Andres Rojas. All rights reserved.
//

#import "BeanGunConfigIdx.h"

@implementation BeanGunConfigIdx

- (instancetype)initWithDict:(NSDictionary *)dict {
    if(self = [super init]) {
        if([[dict allKeys] containsObject:@"gunIdx"]) {
            self.gunIdx = dict[@"gunIdx"] ;
        }
        if([[dict allKeys] containsObject:@"gunAlias0"]) {
            self.gunAlias0 = dict[@"gunAlias0"] ;
        }
        if([[dict allKeys] containsObject:@"gunAlias1"]) {
            self.gunAlias1 = dict[@"gunAlias1"] ;
        }
        if([[dict allKeys] containsObject:@"gunAlias2"]) {
            self.gunAlias2 = dict[@"gunAlias2"] ;
        }
    }
    return self;
}

+ (instancetype)beanWithDict:(NSDictionary *)dict {
    return [[self alloc]initWithDict:dict];
}

- (NSString *)description {
    return [NSString stringWithFormat:@"BeanGunConfigIdx-: gunIdx:%@, Alias0:%@, Alias1:%@, Alias2:%@", self.gunIdx, self.gunAlias0, self.gunAlias1, self.gunAlias2];
}

@end
